<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>BidiFormatter (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>

  <script type="text/javascript" src="//www.google.com/jsapi"></script>
  <script type="text/javascript">
     google.load("visualization", "1", {packages:["orgchart"]});
     var _loadingVisualizations = true;
  </script>

  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
        <span class="fn">i18n.BidiFormatter</span>
        <span>Extends</span>
        <span class="fn-name">
          Object
        </span>
</div>

<div class="g-section g-tpl-75-25">
  <div class="g-unit g-first" id="description">
    Utility class for formatting text for display in a potentially
opposite-directionality context without garbling. Provides the following
functionality:

1. BiDi Wrapping
When text in one language is mixed into a document in another, opposite-
directionality language, e.g. when an English business name is embedded in a
Hebrew web page, both the inserted string and the text following it may be
displayed incorrectly unless the inserted string is explicitly separated
from the surrounding text in a "wrapper" that declares its directionality at
the start and then resets it back at the end. This wrapping can be done in
HTML mark-up (e.g. a 'span dir="rtl"' tag) or - only in contexts where
mark-up can not be used - in Unicode BiDi formatting codes (LRE|RLE and PDF).
Providing such wrapping services is the basic purpose of the BiDi formatter.

2. Directionality estimation
How does one know whether a string about to be inserted into surrounding
text has the same directionality? Well, in many cases, one knows that this
must be the case when writing the code doing the insertion, e.g. when a
localized message is inserted into a localized page. In such cases there is
no need to involve the BiDi formatter at all. In the remaining cases, e.g.
when the string is user-entered or comes from a database, the language of
the string (and thus its directionality) is not known a priori, and must be
estimated at run-time. The BiDi formatter does this automatically.

3. Escaping
When wrapping plain text - i.e. text that is not already HTML or HTML-
escaped - in HTML mark-up, the text must first be HTML-escaped to prevent XSS
attacks and other nasty business. This of course is always true, but the
escaping can not be done after the string has already been wrapped in
mark-up, so the BiDi formatter also serves as a last chance and includes
escaping services.

Thus, in a single call, the formatter will escape the input string as
specified, determine its directionality, and wrap it as necessary. It is
then up to the caller to insert the return value in the output.

See <a href="http://wiki/Main/TemplatesAndBiDi">http://wiki/Main/TemplatesAndBiDi</a> for more information.
  </div>


        <div class="g-unit" id="useful-links">
          <div class="title">Useful links</div>
          <ol>
            <li><a href="closure_goog_i18n_bidiformatter.js.source.html"><span class='source-code-link'>Source Code</span></a></li>
            <li><a href="http://code.google.com/p/closure-library/source/browse/closure/goog/i18n/bidiformatter.js">Git</a></li>
          </ol>
        </div>
</div>






<h2 class="g-first">Inheritance</h2>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
  <tr><td>goog.i18n.BidiFormatter</td><td></td></tr>
</table>
</div>
<div class='gviz-org-chart-container goog-inline-block'>
<table class='gviz-org-chart' style='display:none'>
</table>
</div>




  <h2>Constructor</h2>
      <div class="fn-constructor">
    goog.i18n.BidiFormatter(<span><span class="arg">contextDir</span>,&nbsp;<span class="arg">opt_alwaysSpan</span></span>)
  </div>

   <h3>Parameters</h3>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">contextDir</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>)</div>
        <div class="entryOverview">The context directionality. May be supplied either as a goog.i18n.bidi.Dir constant, as a number (positive = LRT, negative = RTL, 0 = unknown) or as a boolean (true = RTL, false = LTR).</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_alwaysSpan</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether #spanWrap should always use a &amp;#39;span&amp;#39; tag, even when the input directionality is neutral or matches the context, so that the DOM structure of the output does not depend on the combination of directionalities. Default: false.</div>
     </td>
   </tr>
  </table>


<h2>Instance Methods</h2>


  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_i18n_BidiFormatter.html">
              goog.i18n.BidiFormatter
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.areDirectionalitiesOpposite_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">areDirectionalitiesOpposite_<span class="args">(<span class="arg">dir1</span>,&nbsp;<span class="arg">dir2</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       Returns true if two given directionalities are opposite.
Note: the implementation is based on the numeric values of the Dir enum.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dir1</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">1st directionality.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">dir2</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">2nd directionality.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            Whether the directionalities are opposite.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line159">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.dirAttr"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">dirAttr<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns &amp;#39;dir=&amp;quot;ltr&amp;quot;&amp;#39; or &amp;#39;dir=&amp;quot;rtl&amp;quot;&amp;#39;, depending on <code>str</code>&amp;#39;s estimated
directionality, if it is not the same as the context directionality.
Otherwise, returns the empty string.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Text whose directionality is to be estimated.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            'dir="rtl"' for RTL text in non-RTL context; 'dir="ltr"' for LTR text in non-LTR context; else, the empty string.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line242">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.dirAttrValue"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">dirAttrValue<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns &amp;quot;rtl&amp;quot; if <code>str</code>&amp;#39;s estimated directionality is RTL, and &amp;quot;ltr&amp;quot; if
it is LTR. In case it&amp;#39;s UNKNOWN, returns &amp;quot;rtl&amp;quot; if the context directionality
is RTL, and &amp;quot;ltr&amp;quot; otherwise.
Needed for GXP, which can&amp;#39;t handle dirAttr.
Example use case:
<table><td></td></table>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">Text whose directionality is to be estimated.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            "rtl" or "ltr", according to the logic described above.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line209">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.dirResetIfNeeded_"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">dirResetIfNeeded_<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">dir</span>,&nbsp;<span class="arg">opt_isHtml</span>,&nbsp;<span class="arg">opt_dirReset</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a unicode BiDi mark matching the context directionality (LRM or
RLM) if <code>opt_dirReset</code>, and if either the directionality or the exit
directionality of <code>str</code> is opposite to the context directionality.
Otherwise returns the empty string.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">dir</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview"><code>str</code>&amp;#39;s overall directionality.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_dirReset</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether to perform the reset. Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            A unicode BiDi mark or the empty string.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line179">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.endEdge"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">endEdge<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns 'left' for RTL context directionality. Otherwise (LTR or neutral /
unknown context directionality) returns 'right'.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            'left' for RTL context directionality and 'right' for other context directionality.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line485">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.estimateDirection"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">estimateDirection<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
      </div>


     <div class="entryOverview">
       Returns the directionality of input argument <code>str</code>.
Identical to goog.i18n.bidi.estimateDirection.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>&nbsp;
            Estimated overall directionality of <code>str</code>.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line146">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.getAlwaysSpan"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getAlwaysSpan<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>&nbsp;
            Whether alwaysSpan is set.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line110">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.getContextDir"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">getContextDir<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>&nbsp;
            The context directionality.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line102">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.knownDirAttr"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">knownDirAttr<span class="args">(<span class="arg">dir</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns 'dir="ltr"' or 'dir="rtl"', depending on the given directionality, if
it is not the same as the context directionality. Otherwise, returns the
empty string.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dir</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">A directionality.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            'dir="rtl"' for RTL text in non-RTL context; 'dir="ltr"' for LTR text in non-LTR context; else, the empty string.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line256">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.knownDirAttrValue"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">knownDirAttrValue<span class="args">(<span class="arg">dir</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns "rtl" if the given directionality is RTL, and "ltr" if it is LTR. In
case it's UNKNOWN, returns "rtl" if the context directionality is RTL, and
"ltr" otherwise.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dir</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview">A directionality.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            "rtl" or "ltr", according to the logic described above.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line222">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.mark"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">mark<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns the Unicode BiDi mark matching the context directionality (LRM for
LTR context directionality, RLM for RTL context directionality), or the
empty string for neutral / unknown context directionality.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            LRM for LTR context directionality and RLM for RTL context directionality.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line453">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.markAfter"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">markAfter<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns a Unicode BiDi mark matching the context directionality (LRM or RLM)
if the directionality or the exit directionality of <code>str</code> are opposite
to the context directionality. Otherwise returns the empty string.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            A Unicode bidi mark matching the global directionality or the empty string.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line439">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.setAlwaysSpan"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setAlwaysSpan<span class="args">(<span class="arg">alwaysSpan</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">alwaysSpan</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
        <div class="entryOverview">Whether #spanWrap should always use a &amp;#39;span&amp;#39; tag, even when the input directionality is neutral or matches the context, so that the DOM structure of the output does not depend on the combination of directionalities.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line132">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.setContextDir"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">setContextDir<span class="args">(<span class="arg">contextDir</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       <span class='nodesc'>No description.</span>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">contextDir</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>)</div>
        <div class="entryOverview">The context directionality. May be supplied either as a goog.i18n.bidi.Dir constant, as a number (positive = LRT, negative = RTL, 0 = unknown) or as a boolean (true = RTL, false = LTR).</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line121">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.spanWrap"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">spanWrap<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>,&nbsp;<span class="arg">opt_dirReset</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Formats a string of unknown directionality for use in HTML output of the
context directionality, so an opposite-directionality string is neither
garbled nor garbles what follows it.
The algorithm: estimates the directionality of input argument <code>str</code>. In
case its directionality doesn&amp;amp;#39;t match the context directionality, wraps it
with a &amp;amp;#39;span&amp;amp;#39; tag and adds a &amp;amp;quot;dir&amp;amp;quot; attribute (either &amp;amp;#39;dir=&amp;amp;quot;rtl&amp;amp;quot;&amp;amp;#39; or
&amp;amp;#39;dir=&amp;amp;quot;ltr&amp;amp;quot;&amp;amp;#39;). If setAlwaysSpan(true) was used, the input is always wrapped
with &amp;amp;#39;span&amp;amp;#39;, skipping just the dir attribute when it&amp;amp;#39;s not needed.

If <code>opt_dirReset</code>, and if the overall directionality or the exit
directionality of <code>str</code> are opposite to the context directionality, a
trailing unicode BiDi mark matching the context directionality is appened
(LRM or RLM).

If !<code>opt_isHtml</code>, HTML-escapes <code>str</code> regardless of wrapping.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_dirReset</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether to append a trailing unicode bidi mark matching the context directionality, when needed, to prevent the possible garbling of whatever may follow <code>str</code>. Default: true.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Input text after applying the above processing.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line290">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.spanWrapWithKnownDir"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">spanWrapWithKnownDir<span class="args">(<span class="arg">dir</span>,&nbsp;<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>,&nbsp;<span class="arg">opt_dirReset</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Formats a string of given directionality for use in HTML output of the
context directionality, so an opposite-directionality string is neither
garbled nor garbles what follows it.
The algorithm: If <code>dir</code> doesn&amp;amp;#39;t match the context directionality, wraps
<code>str</code> with a &amp;amp;amp;#39;span&amp;amp;amp;#39; tag and adds a &amp;amp;amp;quot;dir&amp;amp;amp;quot; attribute (either &amp;amp;amp;#39;dir=&amp;amp;amp;quot;rtl&amp;amp;amp;quot;&amp;amp;amp;#39;
or &amp;amp;amp;#39;dir=&amp;amp;amp;quot;ltr&amp;amp;amp;quot;&amp;amp;amp;#39;). If setAlwaysSpan(true) was used, the input is always wrapped
with &amp;amp;amp;#39;span&amp;amp;amp;#39;, skipping just the dir attribute when it&amp;amp;amp;#39;s not needed.

If <code>opt_dirReset</code>, and if <code>dir</code> or the exit directionality of
<code>str</code> are opposite to the context directionality, a trailing unicode
BiDi mark matching the context directionality is appened (LRM or RLM).

If !<code>opt_isHtml</code>, HTML-escapes <code>str</code> regardless of wrapping.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dir</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview"><code>str</code>&amp;#39;s overall directionality.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_dirReset</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether to append a trailing unicode bidi mark matching the context directionality, when needed, to prevent the possible garbling of whatever may follow <code>str</code>. Default: true.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Input text after applying the above processing.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line321">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.startEdge"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">startEdge<span class="args">()</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Returns 'right' for RTL context directionality. Otherwise (LTR or neutral /
unknown context directionality) returns 'left'.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            'right' for RTL context directionality and 'left' for other context directionality.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line472">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.unicodeWrap"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">unicodeWrap<span class="args">(<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>,&nbsp;<span class="arg">opt_dirReset</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Formats a string of unknown directionality for use in plain-text output of
the context directionality, so an opposite-directionality string is neither
garbled nor garbles what follows it.
As opposed to #spanWrap, this makes use of unicode BiDi formatting
characters. In HTML, its *only* valid use is inside of elements that do not
allow mark-up, e.g. an &amp;amp;#39;option&amp;amp;#39; tag.
The algorithm: estimates the directionality of input argument <code>str</code>.
In case it doesn&amp;amp;#39;t match  the context directionality, wraps it with Unicode
BiDi formatting characters: RLE<code>str</code>PDF for RTL text, and
LRE<code>str</code>PDF for LTR text.

If <code>opt_dirReset</code>, and if the overall directionality or the exit
directionality of <code>str</code> are opposite to the context directionality, a
trailing unicode BiDi mark matching the context directionality is appended
(LRM or RLM).

Does *not* do HTML-escaping regardless of the value of <code>opt_isHtml</code>.
The return value can be HTML-escaped as necessary.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_dirReset</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether to append a trailing unicode bidi mark matching the context directionality, when needed, to prevent the possible garbling of whatever may follow <code>str</code>. Default: true.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Input text after applying the above processing.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line375">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.i18n.BidiFormatter.prototype.unicodeWrapWithKnownDir"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryName">unicodeWrapWithKnownDir<span class="args">(<span class="arg">dir</span>,&nbsp;<span class="arg">str</span>,&nbsp;<span class="arg">opt_isHtml</span>,&nbsp;<span class="arg">opt_dirReset</span>)</span>
        </span>
        &#8658; <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
      </div>


     <div class="entryOverview">
       Formats a string of given directionality for use in plain-text output of the
context directionality, so an opposite-directionality string is neither
garbled nor garbles what follows it.
As opposed to #spanWrapWithKnownDir, makes use of unicode BiDi
formatting characters. In HTML, its *only* valid use is inside of elements
that do not allow mark-up, e.g. an &amp;amp;#39;option&amp;amp;#39; tag.
The algorithm: If <code>dir</code> doesn&amp;amp;#39;t match the context directionality, wraps
<code>str</code> with Unicode BiDi formatting characters: RLE<code>str</code>PDF for
RTL text, and LRE<code>str</code>PDF for LTR text.

If <code>opt_dirReset</code>, and if the overall directionality or the exit
directionality of <code>str</code> are opposite to the context directionality, a
trailing unicode BiDi mark matching the context directionality is appended
(LRM or RLM).

Does *not* do HTML-escaping regardless of the value of <code>opt_isHtml</code>.
The return value can be HTML-escaped as necessary.
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">dir</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
        <div class="entryOverview"><code>str</code>&amp;#39;s overall directionality.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">str</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>
        <div class="entryOverview">The input text.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">opt_isHtml</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether <code>str</code> is HTML / HTML-escaped. Default: false.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">opt_dirReset</span>
        : <div class="fullType">(<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span><span>&nbsp;|&nbsp;</span><span class="type">undefined</span>)</div>
        <div class="entryOverview">Whether to append a trailing unicode bidi mark matching the context directionality, when needed, to prevent the possible garbling of whatever may follow <code>str</code>. Default: true.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/String">string</a></span></div>&nbsp;
            Input text after applying the above processing.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line410">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>




<h2>Instance Properties</h2>







<div>
       <div class="desc">
         Defined in
         <span class="fn-name">
            <a href="class_goog_i18n_BidiFormatter.html">
              goog.i18n.BidiFormatter
            </a>
         </span>
       </div>






<div class="section">
  <table class="horiz-rule">


     <tr class="even entry private">
       <td class="access"></td>





  <a name="goog.i18n.BidiFormatter.prototype.alwaysSpan_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">alwaysSpan_</span>
        : <div class="fullType"><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span></div>
     </div>


     <div class="entryOverview">
       Whether #spanWrap and similar methods should always use the same
span structure, regardless of the combination of directionalities, for a
stable DOM structure.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line95">Code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry private">
       <td class="access"></td>





  <a name="goog.i18n.BidiFormatter.prototype.contextDir_"></a>

  <td>


     <div class="arg">
        <img align="left" src="static/images/blank.gif">

        <span class="entryName">contextDir_</span>
        : <div class="fullType"><span class="type">goog.i18n.bidi.Dir</span>.&lt;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&gt;</div>
     </div>


     <div class="entryOverview">
       The overall directionality of the context in which the formatter is being
used.
     </div>

  </td>


  <td class="view-code">
     <a href="closure_goog_i18n_bidiformatter.js.source.html#line86">Code &raquo;</a>
  </td>
     </tr>


  </table>
</div>
</div>










<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>
      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package i18n</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="i18n.BidiFormatter"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
